Skip to content

adding index to improve query performance#4284

Merged
jgao54 merged 2 commits into
mainfrom
joygao/add-index
May 6, 2026
Merged

adding index to improve query performance#4284
jgao54 merged 2 commits into
mainfrom
joygao/add-index

Conversation

@jgao54

@jgao54 jgao54 commented May 6, 2026

Copy link
Copy Markdown
Contributor

Adding an index to speed up the following query, which can be expensive for long-running services with high batch volumes.

UPDATE peerdb_stats.cdc_batches SET end_time = NOW() WHERE flow_name = $1 AND batch_id <= $2 AND end_time IS NULL

We cannot directly add this to the .sql migration script because the refinery library wrap all migrations in transactions and would not support concurrently. So instead the plan is to introduce a temporary workaround:

  1. create the non-transactional concurrent index dynamically in code
  2. deploy the change
  3. add 'CREATE INDEX IF NOT EXISTS' with the same index name via sql migration script (should no-op)
  4. delete the code change

@jgao54 jgao54 requested a review from Jeremyyang920 May 6, 2026 22:27
@codecov

codecov Bot commented May 6, 2026

Copy link
Copy Markdown

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
2231 2 2229 203
View the top 2 failed test(s) by shortest run time
github.com/PeerDB-io/peerdb/flow/e2e::TestApiPg
Stack Traces | 0.01s run time
=== RUN   TestApiPg
=== PAUSE TestApiPg
=== CONT  TestApiPg
--- FAIL: TestApiPg (0.01s)
github.com/PeerDB-io/peerdb/flow/e2e::TestApiPg/TestTableAdditionWithoutInitialLoad
Stack Traces | 129s run time
=== RUN   TestApiPg/TestTableAdditionWithoutInitialLoad
=== PAUSE TestApiPg/TestTableAdditionWithoutInitialLoad
=== CONT  TestApiPg/TestTableAdditionWithoutInitialLoad
2026/05/06 22:24:46 INFO Received AWS credentials from peer for connector: ci x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN}
2026/05/06 22:24:46 INFO Received AWS credentials from peer for connector: clickhouse x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN}
    api_test.go:2500: WaitFor wait for initial load to finish 2026-05-06 22:24:50.413292477 +0000 UTC m=+316.148413969
2026/05/06 22:24:50 INFO Executing and processing query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table1\" ORDER BY id"
2026/05/06 22:24:50 INFO Executing and processing query stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table1\" ORDER BY id"
2026/05/06 22:24:50 INFO [pg_query_executor] declared cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursorQuery="DECLARE peerdb_cursor_5826048479397603854 CURSOR FOR SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table1\" ORDER BY id" args=[]
2026/05/06 22:24:50 INFO [pg_query_executor] fetching rows start x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table1\" ORDER BY id" channelLen=0
2026/05/06 22:24:50 INFO Executing and processing query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_whsq3ykw.\"original\" ORDER BY id"
2026/05/06 22:24:50 INFO Executing and processing query stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_whsq3ykw.\"original\" ORDER BY id"
2026/05/06 22:24:50 INFO [pg_query_executor] declared cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursorQuery="DECLARE peerdb_cursor_12769816945995017233 CURSOR FOR SELECT id,val FROM e2e_test_api_whsq3ykw.\"original\" ORDER BY id" args=[]
2026/05/06 22:24:50 INFO [pg_query_executor] fetching rows start x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_whsq3ykw.\"original\" ORDER BY id" channelLen=0
2026/05/06 22:24:50 INFO [pg_query_executor] fetching from cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_5826048479397603854
2026/05/06 22:24:50 INFO processed row stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_5826048479397603854 records=1 bytes=9 channelLen=0
2026/05/06 22:24:50 INFO [pg_query_executor] fetched rows x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table1\" ORDER BY id" rows=1 bytes=9 channelLen=0
2026/05/06 22:24:50 INFO [pg_query_executor] fetching from cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_5826048479397603854
2026/05/06 22:24:50 INFO processed row stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_5826048479397603854 records=0 bytes=0 channelLen=0
2026/05/06 22:24:50 INFO [pg_query_executor] fetched rows x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table1\" ORDER BY id" rows=0 bytes=0 channelLen=0
2026/05/06 22:24:50 INFO [pg_query_executor] committing transaction x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart
2026/05/06 22:24:50 INFO [pg_query_executor] committed transaction for query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table1\" ORDER BY id" rows=1 bytes=9 channelLen=0
2026/05/06 22:24:50 INFO [pg_query_executor] fetching from cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_12769816945995017233
2026/05/06 22:24:50 INFO processed row stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_12769816945995017233 records=1 bytes=9 channelLen=0
2026/05/06 22:24:50 INFO [pg_query_executor] fetched rows x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_whsq3ykw.\"original\" ORDER BY id" rows=1 bytes=9 channelLen=0
2026/05/06 22:24:50 INFO [pg_query_executor] fetching from cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_12769816945995017233
2026/05/06 22:24:50 INFO processed row stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_12769816945995017233 records=0 bytes=0 channelLen=0
2026/05/06 22:24:50 INFO [pg_query_executor] fetched rows x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_whsq3ykw.\"original\" ORDER BY id" rows=0 bytes=0 channelLen=0
2026/05/06 22:24:50 INFO [pg_query_executor] committing transaction x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart
2026/05/06 22:24:50 INFO [pg_query_executor] committed transaction for query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_whsq3ykw.\"original\" ORDER BY id" rows=1 bytes=9 channelLen=0
2026/05/06 22:24:50 INFO Executing and processing query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table2\" ORDER BY id"
2026/05/06 22:24:50 INFO Executing and processing query stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table2\" ORDER BY id"
2026/05/06 22:24:50 INFO [pg_query_executor] declared cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursorQuery="DECLARE peerdb_cursor_6990685608456228553 CURSOR FOR SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table2\" ORDER BY id" args=[]
2026/05/06 22:24:50 INFO [pg_query_executor] fetching rows start x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table2\" ORDER BY id" channelLen=0
2026/05/06 22:24:50 INFO [pg_query_executor] fetching from cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_6990685608456228553
2026/05/06 22:24:50 INFO processed row stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_6990685608456228553 records=1 bytes=9 channelLen=0
2026/05/06 22:24:50 INFO [pg_query_executor] fetched rows x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table2\" ORDER BY id" rows=1 bytes=9 channelLen=0
2026/05/06 22:24:50 INFO [pg_query_executor] fetching from cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_6990685608456228553
2026/05/06 22:24:50 INFO processed row stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_6990685608456228553 records=0 bytes=0 channelLen=0
2026/05/06 22:24:50 INFO [pg_query_executor] fetched rows x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table2\" ORDER BY id" rows=0 bytes=0 channelLen=0
2026/05/06 22:24:50 INFO [pg_query_executor] committing transaction x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart
2026/05/06 22:24:50 INFO [pg_query_executor] committed transaction for query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table2\" ORDER BY id" rows=1 bytes=9 channelLen=0
    api_test.go:2510: WaitFor wait for pause for add table 2026-05-06 22:24:50.43030674 +0000 UTC m=+316.165428241
    api_test.go:2531: WaitFor wait for table addition to finish 2026-05-06 22:24:52.43869677 +0000 UTC m=+318.173818271
2026/05/06 22:24:52 INFO Executing and processing query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table1\" ORDER BY id"
2026/05/06 22:24:52 INFO Executing and processing query stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table1\" ORDER BY id"
2026/05/06 22:24:52 INFO [pg_query_executor] declared cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursorQuery="DECLARE peerdb_cursor_10287737275786902843 CURSOR FOR SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table1\" ORDER BY id" args=[]
2026/05/06 22:24:52 INFO [pg_query_executor] fetching rows start x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table1\" ORDER BY id" channelLen=0
2026/05/06 22:24:52 INFO [pg_query_executor] fetching from cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_10287737275786902843
2026/05/06 22:24:52 INFO processed row stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_10287737275786902843 records=2 bytes=19 channelLen=1
2026/05/06 22:24:52 INFO [pg_query_executor] fetched rows x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table1\" ORDER BY id" rows=2 bytes=19 channelLen=1
2026/05/06 22:24:52 INFO [pg_query_executor] fetching from cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_10287737275786902843
2026/05/06 22:24:52 INFO processed row stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_10287737275786902843 records=0 bytes=0 channelLen=0
2026/05/06 22:24:52 INFO [pg_query_executor] fetched rows x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table1\" ORDER BY id" rows=0 bytes=0 channelLen=0
2026/05/06 22:24:52 INFO [pg_query_executor] committing transaction x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart
2026/05/06 22:24:52 INFO [pg_query_executor] committed transaction for query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table1\" ORDER BY id" rows=2 bytes=19 channelLen=0
    api_test.go:2560: WaitFor test cdc of cdc_only table addition 2026-05-06 22:24:54.445507846 +0000 UTC m=+320.180629347
2026/05/06 22:24:54 INFO Executing and processing query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table1\" ORDER BY id"
2026/05/06 22:24:54 INFO Executing and processing query stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table1\" ORDER BY id"
2026/05/06 22:24:54 INFO [pg_query_executor] declared cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursorQuery="DECLARE peerdb_cursor_1709162143937667416 CURSOR FOR SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table1\" ORDER BY id" args=[]
2026/05/06 22:24:54 INFO [pg_query_executor] fetching rows start x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table1\" ORDER BY id" channelLen=0
2026/05/06 22:24:54 INFO [pg_query_executor] fetching from cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_1709162143937667416
2026/05/06 22:24:54 INFO processed row stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_1709162143937667416 records=2 bytes=19 channelLen=1
2026/05/06 22:24:54 INFO [pg_query_executor] fetched rows x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table1\" ORDER BY id" rows=2 bytes=19 channelLen=1
2026/05/06 22:24:54 INFO [pg_query_executor] fetching from cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_1709162143937667416
2026/05/06 22:24:54 INFO processed row stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_1709162143937667416 records=0 bytes=0 channelLen=0
2026/05/06 22:24:54 INFO [pg_query_executor] fetched rows x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table1\" ORDER BY id" rows=0 bytes=0 channelLen=0
2026/05/06 22:24:54 INFO [pg_query_executor] committing transaction x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart
2026/05/06 22:24:54 INFO [pg_query_executor] committed transaction for query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table1\" ORDER BY id" rows=2 bytes=19 channelLen=0
    clickhouse.go:97: 
        	Error Trace:	.../flow/e2e/congen.go:44
        	            				.../flow/e2e/clickhouse.go:97
        	            				.../flow/e2e/clickhouse.go:79
        	            				.../flow/e2e/clickhouse.go:154
        	            				.../flow/e2e/test_utils.go:240
        	            				.../flow/e2e/test_utils.go:852
        	            				.../flow/e2e/test_utils.go:237
        	            				.../flow/e2e/api_test.go:2560
        	Error:      	Received unexpected error:
        	            	unable to establish connection with catalog: FATAL: terminating connection due to administrator command (SQLSTATE 57P01)
        	Test:       	TestApiPg/TestTableAdditionWithoutInitialLoad
    api_test.go:49: begin tearing down postgres schema api_whsq3ykw
2026/05/06 22:24:55 INFO Executing and processing query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table1\" ORDER BY id"
2026/05/06 22:24:55 INFO Executing and processing query stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table1\" ORDER BY id"
2026/05/06 22:24:55 INFO [pg_query_executor] declared cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursorQuery="DECLARE peerdb_cursor_9150317871435315518 CURSOR FOR SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table1\" ORDER BY id" args=[]
2026/05/06 22:24:55 INFO [pg_query_executor] fetching rows start x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table1\" ORDER BY id" channelLen=0
2026/05/06 22:24:55 INFO [pg_query_executor] fetching from cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_9150317871435315518
2026/05/06 22:24:55 INFO processed row stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_9150317871435315518 records=2 bytes=19 channelLen=1
2026/05/06 22:24:55 INFO [pg_query_executor] fetched rows x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table1\" ORDER BY id" rows=2 bytes=19 channelLen=1
2026/05/06 22:24:55 INFO [pg_query_executor] fetching from cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_9150317871435315518
2026/05/06 22:24:55 INFO processed row stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_9150317871435315518 records=0 bytes=0 channelLen=0
2026/05/06 22:24:55 INFO [pg_query_executor] fetched rows x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table1\" ORDER BY id" rows=0 bytes=0 channelLen=0
2026/05/06 22:24:55 INFO [pg_query_executor] committing transaction x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart
2026/05/06 22:24:55 INFO [pg_query_executor] committed transaction for query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_gvqx9s0e.\"table1\" ORDER BY id" rows=2 bytes=19 channelLen=0
    api_test.go:49: 
        	Error Trace:	.../flow/e2e/pg.go:147
        	            				.../flow/e2e/api_test.go:49
        	            				.../flow/e2eshared/e2eshared.go:38
        	            				.../hostedtoolcache/go/1.26.2.../src/testing/testing.go:1317
        	            				.../hostedtoolcache/go/1.26.2.../src/testing/testing.go:1667
        	            				.../hostedtoolcache/go/1.26.2.../src/testing/testing.go:2030
        	            				.../hostedtoolcache/go/1.26.2.../src/runtime/panic.go:694
        	            				.../hostedtoolcache/go/1.26.2.../src/testing/testing.go:1022
        	            				.../flow/e2e/congen.go:44
        	            				.../flow/e2e/clickhouse.go:97
        	            				.../flow/e2e/clickhouse.go:79
        	            				.../flow/e2e/clickhouse.go:154
        	            				.../flow/e2e/test_utils.go:240
        	            				.../flow/e2e/test_utils.go:852
        	            				.../flow/e2e/test_utils.go:237
        	            				.../flow/e2e/api_test.go:2560
        	            				.../hostedtoolcache/go/1.26.2.../src/reflect/value.go:586
        	            				.../hostedtoolcache/go/1.26.2.../src/reflect/value.go:369
        	            				.../flow/e2eshared/e2eshared.go:40
        	Error:      	failed to teardown postgres schema
        	Test:       	TestApiPg/TestTableAdditionWithoutInitialLoad
        	Messages:   	api_whsq3ykw: failed to drop replication slots: ERROR: replication slot "peerflow_slot_added_tables_no_initial_load_api_whsq3ykw" is active for PID 10946 (SQLSTATE 55006)
--- FAIL: TestApiPg/TestTableAdditionWithoutInitialLoad (129.37s)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

🔄 Flaky Test Detected

Analysis: The test TestApiPg/TestTableAdditionWithoutInitialLoad failed during teardown due to a race condition where the background peer-flow worker process still held the PostgreSQL replication slot active when cleanup tried to drop it (SQLSTATE 55006), not due to any failure in the actual test logic.
Confidence: 0.92

✅ Automatically retrying the workflow

View workflow run

@jgao54 jgao54 marked this pull request as ready for review May 6, 2026 22:50
@jgao54 jgao54 requested a review from a team as a code owner May 6, 2026 22:50
@claude

claude Bot commented May 6, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@jgao54 jgao54 merged commit e457c60 into main May 6, 2026
22 checks passed
@jgao54 jgao54 deleted the joygao/add-index branch May 6, 2026 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants